Skip to content

doc: use @node-core/remark-lint for linting#62090

Open
avivkeller wants to merge 5 commits intonodejs:mainfrom
avivkeller:lint-doc-kit
Open

doc: use @node-core/remark-lint for linting#62090
avivkeller wants to merge 5 commits intonodejs:mainfrom
avivkeller:lint-doc-kit

Conversation

@avivkeller
Copy link
Member

@avivkeller avivkeller commented Mar 3, 2026

This PR lints the documentation according to https://www.npmjs.com/package/@node-core/remark-lint, the linter which uses doc-kit to lint.

The differences with this linter are:

  • No duplicate stability nodes
  • No invalid types
  • --- instead of ***, like is used in other organization repos
  • Changes must have full URLs and full SHAs
  • Types cannot be separated with a , just a |

Copilot AI review requested due to automatic review settings March 3, 2026 16:08
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/actions
  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/loaders
  • @nodejs/net
  • @nodejs/sqlite
  • @nodejs/test_runner
  • @nodejs/tsc
  • @nodejs/userland-migrations

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. labels Mar 3, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates documentation linting/formatting to @node-core/remark-lint (which leverages doc-kit) and updates the repo to comply with the new lint rules across Markdown and API docs.

Changes:

  • Replace the old tools/lint-md linter with a new tools/doc/lint-md.mjs implementation based on @node-core/remark-lint (including doc/api-specific linting).
  • Rewire make lint-md / make format-md and related dependency installation to use tools/doc.
  • Apply remark-lint-driven formatting updates across documentation (e.g., type union formatting, horizontal rules, changelog metadata formatting).

Reviewed changes

Copilot reviewed 23 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vcbuild.bat Updates Windows build/lint flow to use doctools for Markdown lint/format.
tools/lint-md/package.json Removes legacy Markdown linter package definition.
tools/lint-md/package-lock.json Removes legacy Markdown linter lockfile.
tools/lint-md/lint-md.mjs Removes legacy Markdown lint/format script.
tools/doc/package.json Adds dependencies required for new remark-lint-based Markdown linting.
tools/doc/list-released-versions-from-changelogs.mjs Refactors released-version extraction into an exported helper for linting.
tools/doc/lint-md.mjs Adds new Markdown lint/format entrypoint using @node-core/remark-lint (+ API rules).
doc/type-map.json Updates type map entries to satisfy new API lint rules.
doc/contributing/releases.md Replaces *** separators with --- per remark-lint expectations.
doc/contributing/collaborator-guide.md Replaces *** separators with --- per remark-lint expectations.
doc/changelogs/CHANGELOG_V15.md Replaces *** separators with --- per remark-lint expectations.
doc/changelogs/CHANGELOG_V12.md Replaces *** separators with --- per remark-lint expectations.
doc/changelogs/CHANGELOG_IOJS.md Replaces *** separators with --- per remark-lint expectations.
doc/api/util.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/url.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/test.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/sqlite.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/quic.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/process.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/modules.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/inspector.md Adjusts content to satisfy updated doc linting rules (e.g., stability nodes).
doc/api/https.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/http.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/errors.md Updates changelog YAML metadata (full commit SHA requirement).
doc/api/dns.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/diagnostics_channel.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/deprecations.md Reformats multi-PR YAML metadata into separate entries per lint rules.
doc/api/crypto.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/api/buffer.md Normalizes union type formatting ({a|b}) to satisfy lint rules.
doc/README.md Replaces *** separators with --- per remark-lint expectations.
Makefile Points lint-md / format-md targets to tools/doc/lint-md.mjs and doctools deps.
CHANGELOG.md Replaces *** separators with --- per remark-lint expectations.
.github/workflows/test-macos.yml Removes path trigger references to removed tools/lint-md.
.github/workflows/linters.yml Removes the old “get released versions” step for the prior linter flow.
.github/workflows/coverage-windows.yml Removes path trigger references to removed tools/lint-md.
.github/workflows/build-tarball.yml Removes path trigger references to removed tools/lint-md.
.github/dependabot.yml Removes dependabot updates for the removed tools/lint-md package.
Comments suppressed due to low confidence (1)

.github/workflows/linters.yml:139

  • The workflow removes the get-released-versions step, but the "Lint markdown files" step still sets NODE_RELEASED_VERSIONS from steps.get-released-versions.outputs.... This reference will be undefined and should be removed or replaced (the new markdown linter now computes released versions itself).
      - name: Lint markdown files
        run: |
          echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
          NODE=$(command -v node) make lint-md
        env:
          NODE_RELEASED_VERSIONS: ${{ steps.get-released-versions.outputs.NODE_RELEASED_VERSIONS }}
  lint-nix:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@avivkeller avivkeller added the doc Issues and PRs related to the documentations. label Mar 3, 2026
@avivkeller
Copy link
Member Author

avivkeller commented Mar 3, 2026

This uses overrides right now to ensure that doc-kit is always using the same version, but once nodejs/admin#1046 allows us to publish doc-kit, we can make it a more broad dependency in remark-lint

Comment on lines +2651 to +2653
- version: v11.0.0
pr-url: https://github.com/nodejs/node/pull/23017
description: Runtime deprecation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right, the API was not runtime deprecated in Node.js 11.0.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because this API was runtime deprecated, and had it's deprecation revoked in the same version

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (6a3d358) to head (beef4ea).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62090      +/-   ##
==========================================
+ Coverage   89.58%   89.65%   +0.07%     
==========================================
  Files         674      676       +2     
  Lines      205159   206328    +1169     
  Branches    39352    39528     +176     
==========================================
+ Hits       183792   184986    +1194     
+ Misses      13583    13484      -99     
- Partials     7784     7858      +74     

see 147 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants